package com.futao.eurekaconsumer.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author futao
 * Created on 18-6-6-下午1:18.
 * 使用ribbon实现的消费者，不需要写服务提供者的ip和端口
 */
@RestController
public class RibbonDcController {
    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/autoConsumer")
    public String dc() {
        return restTemplate.getForObject("http://springBootTestProject/users/", String.class);
    }


}
